Skip to content

arch(dev-only): handle 'no storage decision' for all activities in ActivityList#21323

Merged
lukstbit merged 3 commits into
ankidroid:mainfrom
david-allison:entry-points-next-pr
Jul 4, 2026
Merged

arch(dev-only): handle 'no storage decision' for all activities in ActivityList#21323
lukstbit merged 3 commits into
ankidroid:mainfrom
david-allison:entry-points-next-pr

Conversation

@david-allison

Copy link
Copy Markdown
Member

Note

Assisted-by: Claude Fable 5

Purpose / Description

I want collection creation to become part of the onboarding sequence., moving it out of the implicit Collection.withCol

This opens the floor for a 'storage decision': if the user is using a full build - do they want to obtain MANAGE_EXTERNAL_STORAGE, or continue with app-private storage?

In this case, all activities need to handle the possibility that the decision wasn't made yet, or was revoked. Most of these cases have been handled, but these activities remained, typically being launched after process death, or through notifications/app shortcuts.

Fixes

Approach

  • Redirect users to IntentHandler -> DeckPicker if no storage decision is made
    • A centralized point of handling in IntentHandler, in future to be moved to a selection screen.
  • Handle launchCatchingTask
  • Scaffold for DeckPicker to handle this issue as an error
    • Normally it would be part of startup; DeckPicker should handle the case that this permission was revoked and allow a user to regain access

How Has This Been Tested?

Unit tested

Checklist

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

IntentHandler will handle routing: initially to DeckPicker,
 and later to a screen where the storage decision can be made

Assisted-by: Claude Fable 5
@david-allison david-allison added Review High Priority Request for high priority review and removed Needs Review labels Jun 30, 2026

@criticalAY criticalAY left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpicks, rest all clean, thanks

Comment thread AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.kt Outdated
Comment on lines +19 to +21
* A [StorageNotConfiguredException] escaping a coroutine means an activity raced or
* outlived its [ensureStorageReady][com.ichi2.anki.startup.ensureStorageReady] check:
* the user should be sent to the main entry point, which handles storage setup.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function is ensureStorageIsReady

@criticalAY criticalAY added the Needs Second Approval Has one approval, one more approval to merge label Jul 1, 2026
david-allison and others added 2 commits July 2, 2026 00:02
Assisted-by: Claude Fable 5
Co-authored-by: Ashish Yadav <48384865+criticalAY@users.noreply.github.com>
@david-allison david-allison force-pushed the entry-points-next-pr branch from 33238d0 to 8b93e25 Compare July 1, 2026 23:02
@lukstbit lukstbit added Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) and removed Needs Second Approval Has one approval, one more approval to merge labels Jul 4, 2026
@lukstbit lukstbit added this pull request to the merge queue Jul 4, 2026
Merged via the queue into ankidroid:main with commit 2f5c1de Jul 4, 2026
20 checks passed
@github-actions github-actions Bot removed the Review High Priority Request for high priority review label Jul 4, 2026
@github-actions github-actions Bot added this to the 2.25 release milestone Jul 4, 2026
@github-actions github-actions Bot removed the Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) label Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants